const baseConfig=require("./base.config");
const webpackMerge=require("webpack-merge");
const path=require("path");

const config=webpackMerge(baseConfig,{
    mode:"development",
    devtool:"cheap-module-eval-source-map",
    // ?
    module:{
        rules:[
            {
                test:/\.(css|scss)$/,
                use:["style-loader","css-loader","sass-loader"],
                exclude:path.join(__dirname,"../node_modules")
            }
        ]
    },
    devServer:{
        open:true,
        port:9001,
        historyApiFallback:{
            rewrites:[{
                form:/.*/g,
                to: '/index.html'
            }]
        },
        proxy:{
            "/api":{
                target:"https://wap.showstart.com",
                changeOrigin:true,
                pathRewrite:{
                    "^/api":"/api"
                }
            }
        }
    }

})

module.exports = config;